package com.ccrfid.rmc6.entity.poi;

import com.vividsolutions.jts.geom.Point;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "poi_camera")
public class PoiCameraEntity {
    private Long cameraId;
    private Integer cameraShape;
    private Integer direction;
    private Point pos;
    private Integer floorNumber;
    private Integer permissionLevel = 3;
    private Timestamp createTime;
    private Timestamp updateTime;

    @Id
    @Column(name = "camera_id", nullable = false)
    public Long getCameraId() {
        return cameraId;
    }

    public void setCameraId(Long cameraId) {
        this.cameraId = cameraId;
    }

    @Basic
    @Column(name = "camera_shape", nullable = false)
    public Integer getCameraShape() {
        return cameraShape;
    }

    public void setCameraShape(Integer cameraShape) {
        this.cameraShape = cameraShape;
    }

    @Basic
    @Column(name = "direction", nullable = false)
    public Integer getDirection() {
        return direction;
    }

    public void setDirection(Integer direction) {
        this.direction = direction;
    }

    @Basic
    @Column(name = "pos", nullable = false)
    @Type(type = "jts_geometry")
    public Point getPos() {
        return pos;
    }

    public void setPos(Point pos) {
        this.pos = pos;
    }

    @Basic
    @Column(name = "floor_number", nullable = true)
    public Integer getFloorNumber() {
        return floorNumber;
    }

    public void setFloorNumber(Integer floorNumber) {
        this.floorNumber = floorNumber;
    }

    @Basic
    @Column(name = "permission_level", nullable = false)
    public Integer getPermissionLevel() {
        return permissionLevel;
    }

    public void setPermissionLevel(Integer permissionLevel) {
        this.permissionLevel = permissionLevel;
    }

    @Basic
    @Column(name = "create_time", nullable = false)
    @CreationTimestamp
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time", nullable = false)
    @UpdateTimestamp
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }
}
